package zeebe.object;

import io.zeebe.client.ZeebeClient;
import zeebe.param.Person;

public class ObjStart {
    public static void main(String[] args) {
        ZeebeClient client = ZeebeClient.newClientBuilder()
                .brokerContactPoint("localhost:26500")
                .usePlaintext()
                .build();

        System.out.println("启动工作流");
        String processId = "objZeebe";
        Corporation corporation = new Corporation();
        Person person = new Person();
        person.setName("xiongjie");
        corporation.setTitle("qijian");
        corporation.setPerson(person);

        client.newCreateInstanceCommand()
                .bpmnProcessId(processId)
                .latestVersion()
                .variables(corporation)
                .send()
                .join();
    }
}
